package com.eboy.utils;

import java.io.ByteArrayOutputStream;
import java.io.InputStream;

public class StreamUtils {

	public static byte[] ReadStream(InputStream stream) throws Exception {
		ByteArrayOutputStream outStream = new ByteArrayOutputStream();
		byte[] buff = new byte[1024];
		int len = 0;
		while ((len = stream.read(buff)) != -1 ) {
			outStream.write(buff, 0, len);
		}
		stream.close();
		return outStream.toByteArray();
	}
}
